var PromiseFtp = require('promise-ftp');

var ftp = new PromiseFtp();

console.log(PromiseFtp.STATUSES);

ftp.connect({
    host: "116.10.184.230",
    user: "tv_ailipai",
    password: "m57aJk3BfYwfkfNy",
    keepalive: true
}).then(function (serverMessage) {
        console.log('FTP Connected ! Server message: ' + serverMessage);
    });

setTimeout(function () {
    ftp.put('D:\\ff_test\\out\\1\\1080p\\151902080014.ts', '/tv/368/1/1080p/151902080014.ts')
        .then(function (err) {
            console.log(err);
            console.log(ftp.getConnectionStatus() == PromiseFtp.STATUSES.CONNECTED)
            return ftp.end();
        });
},2000)




/**
 getConnectionStatus()

 not yet connected
 connecting
 connected
 logging out
 disconnecting
 disconnected
 reconnecting
 */